/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package se.bth.ke.firstfriend.model.util;

/**
 *
 * @author nico.rehwaldt
 */
public class Slug {
    public static String createSlug(Object ... components) {

        StringBuilder builder = new StringBuilder();
        for (Object o: components) {
            builder.append(o);
        }

        return builder
                .toString()
                .toLowerCase()
                .replaceAll("[\\s]+", "-")
                .replaceAll("[\\W]+", "");
    }
}
